package com.meirengu.webview.controller;

import com.alibaba.fastjson.JSONObject;
import com.meirengu.common.StatusCode;
import com.meirengu.model.Result;
import com.meirengu.utils.HttpUtil;
import com.meirengu.webview.utils.ConfigUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("test01")
public class testControlle {

    Logger logger = LoggerFactory.getLogger(testControlle.class);


    private static final String LOCK_TITLE = "redisLock_";


    @RequestMapping("sms")
    public void sms() throws Exception {
        String url = ConfigUtil.getConfig("sms.send.url");
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("phoneNumber", "15835132986");
        jsonObject.put("templateCode", "SMS_05");
        HttpUtil.HttpResult hr = HttpUtil.doPost(url, jsonObject.toString());


    }

    @RequestMapping("sms1")
    public void sms1() throws Exception {
        String url = ConfigUtil.getConfig("sms.send.url");
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("phoneNumber", "15835132986");
        jsonObject.put("templateCode", "SMS_06");
        JSONObject templateParam = new JSONObject();
        templateParam.put("name", "老铁");
        jsonObject.put("templateParam", templateParam);
        HttpUtil.HttpResult hr = HttpUtil.doPost(url, jsonObject.toString());
    }

    @RequestMapping("tomcatTest")
    @ResponseBody
    public Result tomcatTest() {
        Result result = new Result();
        result.setCode(StatusCode.OK);
        return result;
    }


}
